#include "Listnode.h"

void test()
{
    ListNode* list = ListCreate();
    ListPushBack(list,1);
    ListPushBack(list,2);
    ListPushBack(list,3);
    ListPushBack(list,4);
    ListPushBack(list,5);
    ListPushFront(list,9999);
    ListPrint(list);

    // ListNode* pos = ListFind(list,3);
    // ListErase(pos);
    // ListPrint(list);

    // printf("%d\n",pos->_data);
    // ListInsert(list,999999);
    // ListPrint(list);
    //ListDestory(list);

    while (list->next != list)
    {
        ListPopBack(list);
        ListPrint(list);
    }

    ListPushFront(list,10);
    ListPushFront(list,20);
    ListPushFront(list,30);
    ListPushFront(list,40);
    ListPushFront(list,50);
    ListPushFront(list,60);
    ListPrint(list);

    while (list->next != list)
    {
        ListPopFront(list);
        ListPrint(list);
    }

    // ListDestory(list);
    // list->_data = 5;
    // printf("%d\n",list->_data);
}

int main()
{
    test();
    return 0;
}



